Skip to content

Add tests for UnusedPropertyRule#4

Merged
lithium147 merged 1 commit into
mainfrom
devin/1772759557-unused-property-rule-tests
Mar 6, 2026
Merged

Add tests for UnusedPropertyRule#4
lithium147 merged 1 commit into
mainfrom
devin/1772759557-unused-property-rule-tests

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Add tests for UnusedPropertyRule

Summary

Adds 14 unit tests for UnusedPropertyRule, covering the core scenarios of the two-model (original + effective) architecture. Also adds missing lombok, findbugs-annotations, and checker-qual dependencies to pom.xml — these were required at compile time because ArtifactV2.java uses Lombok annotations and lombok.config enables findbugs/checkerframework annotation generation.

Tests added

  • Happy paths: version property used by direct dependency, managed dependency, plugin, managed plugin, extension, report plugin, and plugin dependency
  • Violation paths: unused version property detected, multiple unused properties reported, mixed used/unused properties
  • Filtering: non-.version properties are correctly ignored
  • execute(): throws EnforcerRuleException on violations, passes cleanly when all properties are used

Review & Testing Checklist for Human

  • Verify the added pom.xml dependencies are correct — lombok 1.18.36, findbugs-annotations 3.0.1, checker-qual 3.48.4 were added as provided scope. Confirm these versions are appropriate and that they were intentionally absent before (vs. inherited from a parent POM or supplied by an IDE).
  • Check test coverage gaps — no tests for profile-scoped dependencies or for the parent-property-override edge case mentioned in the unusedUseViolation TODO. Decide if these are needed now.
  • Run mvn test locally to confirm all 34 tests pass (note: requires Maven 3.9+ for JUnit 5 surefire support; Maven 3.6.3 bundled with Ubuntu won't work).

Notes


Open with Devin

Co-Authored-By: lithium147@gmail.com <timlwalters@yahoo.co.uk>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@lithium147
lithium147 merged commit 5ec87a8 into main Mar 6, 2026
1 check passed
@lithium147
lithium147 deleted the devin/1772759557-unused-property-rule-tests branch March 8, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant